import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import dts from "vite-plugin-dts";
import { join } from "path";

export default defineConfig({
  resolve: {
    alias: {
      "@": join(__dirname, "src"),
    },
  },
  build: {
    lib: {
      entry: "src/index.ts",
      formats: ["cjs", "es"],
    },
    rollupOptions: {
      external: ["vue"],
    },
  },
  plugins: [
    vue(),
    dts({
      tsconfigPath: "dts.config.json",
    }),
  ],
});
